# 作者:侯征  三级菜单
info={
    "北京":{
        "东城":{
            "和平里北街":["陕味食族","麻食"],
            "安德路北街":["麻辣小面","回锅肉盖饭"],
            "皇城国际":["食堂","咖喱鸡肉"]
        },
        "昌平":{
            "美食城":["味道面馆","茄子面"],
            "天通苑":["烧烤","烤馒头"],
            "北一区":["水果店","苹果"],
        },
        "西城":{
            "南锣鼓巷":["百年老店","驴肉火烧"],
            "积水桥":["武大郎烧饼店","烧饼"],
            "天安门":["北京面馆","炸酱面"],
        },
    },
    "武汉":{
        "流芳":{
            "工程大学":["二食堂","石锅拌饭"],
            "金融港":["山西面馆","油泼面"],
            "步行街":["张亮麻辣烫","15块麻辣套餐"],
        },
        "光谷":{
            "光谷广场":["美食天地","木桶饭"],
            "虎泉夜市":["街边小摊","烤鸡腿"],
            "光谷大厦":["西餐厅","牛排"],
        },
        "汉口":{
            "江滩":["美食节","印度大饼"],
            "汉正街":["重庆小面","麻辣面"],
            "汉口火车站":["地下美食城","热干面"],
        },
    },
    "宜川":{
        "党湾":{
            "党湾街":["狗子面皮","炒面皮"],
            "车站口":["包子店","肉包子"],
            "牙湾路口":["羊肉泡馍店","羊肉泡馍"],
        },
        "南关":{
            "新宜川中学":["食堂","酱香饼"],
            "南关街":["活络馆","羊肉活络"],
            "南关小学":["食堂","西红柿炒鸡蛋"],
        },
        "彩虹桥":{
            "轻工市场":["二女面皮","炒凉粉"],
            "夜市":["肉夹馍小摊","纯廋肉夹馍"],
            "桥边":["小吃店","零食"],
        },
    },
}
# 定义flag,用于终止循环,输入其他时继续执行循环
flag=False
while not flag:
    for i in info:#第一层
        print(i)
    choose=input("请选择城市,按b或q结束:")
    if choose in info:
        while not flag:
            for i in info[choose]:#第二层
                print("\t",i)
            choose1=input("\t请选择地区,按b返回上一层,按q结束:")
            if choose1 in info[choose]:
                while not flag:
                    for i in info[choose][choose1]:#第三层
                        print("\t\t",i)
                    choose2=input("\t\t请选择详细地区,按b返回上一层,按q结束:")
                    if choose2 in info[choose][choose1]:
                        for i in info[choose][choose1][choose2]:
                            print("\t\t",i)
                        back=input("\t\t选择成功,按b返回上一层,按q结束:")
                        if back=="b":
                            pass#跳出for循环
                        elif back=="q":
                            flag=True#结束循环
                    if choose2=="b":
                        break
                    elif choose2=="q":
                        flag=True
            elif choose1=="b":
                break
            elif choose1=="q":
                falg=True
    if choose=="b":
        break
    elif choose=="q":
        flag=True